package com.hoow.shakoow.ai.data

data class RevObjShakeUserInfo(
    /** 钻石余额 */
    val balance: String? = "0",
    /** 折扣率 */
    val discount: Float = 0F,
    /** userId */
    var userId: String? = null,
    /** userAccount */
    var account: String? = null,
    /** vip */
    var vip: Int = 0,
    /** vip type */
    var vipType: String? = "",
    /** free vip */
    var freeVip: String? = "NO",
    /** free iamond */
    var freeDiamond: String? = "NO",
    /** 到期时间 */
    var vipExpired: String? = null,


    /** headImg */
    var headImg: String? = null,
    /** name */
    var name: String? = null,
    /** sex */
    var sex: String? = null,
    /** userPhotos */
    var userPhotos: List<RevObjUserAblum>? = null,
    /** description */
    var description: String? = null,
    /** vipRemindDays */
    var vipRemindDays: String? = null,
    /** shakeId */
    var shakeId: String? = null,

    /** shakeResult */
    var shakeResult: String? = null,

) {

    /** 是否已设置昵称与性别 */
    fun isHadSettingNickNameAndGender(): Boolean {
        val hadNickName = name?.isNotBlank()
        val hadGender = sex?.isNotBlank()

        return ((hadNickName == true) and (hadGender == true))
    }

    /** 获取性别格式 */
    fun getGenderDisplay(): String {
        if (sex.equals("1", true)) {
            return "Male"
        }
        return "Female"
    }

    /** 是否为Free Vip */
    fun isVip(): Boolean {
        return vip > 0
    }

    /** 是否为Free Vip */
    fun isFreeVip(): Boolean {
        return freeVip.orEmpty().equals("YES", true)
    }

    /** 是否为Free Diamond */
    fun isFreeDiamond(): Boolean {
        return freeDiamond.orEmpty().equals("YES", true)
    }

    /** 获取vip有效期 */
    fun realVipExpired(): String {
        val result = vipExpired.orEmpty()
        if (result.isNotBlank()) {
            return "EXPIRY $result"
        }
        return result
    }
}
